package city.spring.modules.system.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 实体类：组织机构
 *
 * @author 侯坤林
 * @date 2020-05-30 14:06:37
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("organization")
public class OrganizationEntity extends BaseRolePermissionEntity implements Serializable {

    /**
     * 主键ID
     */
    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    /**
     * 父级ID
     */
    private String pid;

    /**
     * 组织机构名称
     */
    private String title;

    /**
     * 组织机构备注
     */
    private String remarks;

    /**
     * 版本号
     */
    @Version
    private Integer version;

    /**
     * 创建时间
     */
    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private Date gmtCreate;

    /**
     * 修改时间
     */
    @TableField(insertStrategy = FieldStrategy.NEVER, updateStrategy = FieldStrategy.NEVER)
    private Date gmtModified;

    @TableField(exist = false)
    private List<OrganizationEntity> children;
}